#pragma once

#ifndef _PARAMWIDGET_H__
#define _PARAMWIDGET_H__

#include <QHeaderView>
#include <QDockWidget>
#include <QTableWidget>
#include <QPushButton>
#include <QHBoxLayout>
#include <QCheckBox>
#include <QCommandLinkButton>
#include <QKeyEvent>
#include <QClipboard>
#include <QDialog>
#include <QMessageBox>
#include <QList>

#include "PropertiesAPI.hpp"



NAMESPACE_BEGIN(NSParamWidget)

#define TABKEY 5

class PROPERTYAPI ParamWidget : public QDockWidget {
    Q_OBJECT
    SIGNALDEC(ParamWidget, QDockWidget)
protected:
    void Initialize();
    void Finalize();

Q_SIGNALS:
    void updateSingleParam2TreeSignal(QString key, float value, int id);

public Q_SLOTS:
    void showParamsWidget(int id);
    void updateCellState(int type);
    void onSaveClicked();
    void onCancelClicked();
    void onClearClicked();
    void onCellDoubleClicked(int row, int column);
    void onItemChanged(QTableWidgetItem* item);

private:
    QWidget* widgetCentered(QWidget* res);
    void setEditingId(int id) { editing_id = id; }

private:
    int editing_id;
    QTableWidget* param_table;
    QTableWidget* other_value_table;
    QTableWidgetItem* Item(QString _str);



};







class  TableButton : public QPushButton {
    Q_OBJECT
public:
    explicit TableButton(QWidget* parent = nullptr);
    ~TableButton();

private:

};



NAMESPACE_END

#endif //! _PARAMWIDGET_H__


